# 导包
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
# 打开ecshop演示站
driver = webdriver.Chrome()
driver.get("https://ecshop.test2.shopex123.com/")
driver.maximize_window()   # 全屏显示
# 找到注册按钮并点击进入
driver.find_element(By.CLASS_NAME, "reg").click()
# 定位到用户名注册框,输入内容
driver.find_element(By.ID, "username").send_keys('kkk哈哈')
# 定位注册邮箱输入框,并输入密码
driver.find_element(By.ID, "email").send_keys('19985353@qq.com')
# 定位密码输入框,并输入密码
driver.find_element(By.ID, "password1").send_keys('123456.')
# 定位确认密码输入框,输入密码
driver.find_element(By.ID, "confirm_password").send_keys('123456.')
# 定位同意并注册按钮,并点击
driver.find_element(By.CLASS_NAME, "signup_button").click()

# 关闭ecshop商城
time.sleep(5)
driver.quit()
